TimePeriod

data class TimePeriod<SmallestUnit : TimeUnit> : Comparable<TimePeriod<SmallestUnit>>

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun <DifferenceUnit : TimeUnit> applying(difference: TimeDifference<DifferenceUnit>): TimePeriod<SmallestUnit>
Link copied to clipboard
open operator override fun compareTo(other: TimePeriod<SmallestUnit>): Int
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val firstInstant: Instant
Link copied to clipboard
val lastInstant: Instant
Link copied to clipboard
val range: ClosedRange<Instant>

Retrieve the range of Instants described by this TimePeriod.

Link copied to clipboard
val timeZone: TimeZone

Extensions

Link copied to clipboard
fun <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.addingDays(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of days.

Link copied to clipboard
fun <Unit : HourOrSmaller, TimeUnit> TimePeriod<Unit>.addingHours(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of hours.

Link copied to clipboard
fun <Unit : MinuteOrSmaller, TimeUnit> TimePeriod<Unit>.addingMinutes(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of minutes.

Link copied to clipboard
fun <Unit : MonthOrSmaller, TimeUnit> TimePeriod<Unit>.addingMonths(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of months.

Link copied to clipboard
fun <Unit : NanosecondOrSmaller, TimeUnit> TimePeriod<Unit>.addingNanoseconds(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of nanoseconds.

Link copied to clipboard
fun <Unit : SecondOrSmaller, TimeUnit> TimePeriod<Unit>.addingSeconds(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of seconds.

Link copied to clipboard
fun <Unit : YearOrSmaller, TimeUnit> TimePeriod<Unit>.addingYears(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving forward some number of years.

Link copied to clipboard
fun TimePeriod<*>.after(other: TimePeriod<*>): Boolean
Link copied to clipboard
fun TimePeriod<*>.before(other: TimePeriod<*>): Boolean
Link copied to clipboard
fun TimePeriod<*>.contains(other: TimePeriod<*>): Boolean
Link copied to clipboard
fun <Unit : TimeUnit> TimePeriod<Unit>.convertToTimeZone(timeZone: TimeZone): TimePeriod<Unit>

Construct a new TimePeriod by converting the receiver to a new TimeZone.

Link copied to clipboard
val <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.dayOfMonth: Int
Link copied to clipboard
val <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.dayOfWeek: DayOfWeek
Link copied to clipboard
val <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.dayOfYear: Int
Link copied to clipboard
Link copied to clipboard
@get:JvmName(name = "monthDays")
val TimePeriod<TimeUnit.Month>.days: Sequence<TimePeriod<TimeUnit.Day>>
@get:JvmName(name = "yearDays")
val TimePeriod<TimeUnit.Year>.days: Sequence<TimePeriod<TimeUnit.Day>>
Link copied to clipboard
fun TimePeriod<*>.during(other: TimePeriod<*>): Boolean
Link copied to clipboard
@get:JvmName(name = "yearFirstDay")
val TimePeriod<TimeUnit.Year>.firstDay: TimePeriod<TimeUnit.Day>
@get:JvmName(name = "monthFirstDay")
val TimePeriod<TimeUnit.Month>.firstDay: TimePeriod<TimeUnit.Day>
Link copied to clipboard
@get:JvmName(name = "monthFirstHour")
val TimePeriod<TimeUnit.Month>.firstHour: TimePeriod<TimeUnit.Hour>
@get:JvmName(name = "dayFirstHour")
val TimePeriod<TimeUnit.Day>.firstHour: TimePeriod<TimeUnit.Hour>
Link copied to clipboard
@get:JvmName(name = "dayFirstMinute")
val TimePeriod<TimeUnit.Day>.firstMinute: TimePeriod<TimeUnit.Minute>
@get:JvmName(name = "hourFirstMinute")
val TimePeriod<TimeUnit.Hour>.firstMinute: TimePeriod<TimeUnit.Minute>
Link copied to clipboard
val TimePeriod<TimeUnit.Year>.firstMonth: TimePeriod<TimeUnit.Month>
Link copied to clipboard
@get:JvmName(name = "dayFirstSecond")
val TimePeriod<TimeUnit.Day>.firstSecond: TimePeriod<TimeUnit.Second>
@get:JvmName(name = "hourFirstSecond")
val TimePeriod<TimeUnit.Hour>.firstSecond: TimePeriod<TimeUnit.Second>
@get:JvmName(name = "minuteFirstSecond")
val TimePeriod<TimeUnit.Minute>.firstSecond: TimePeriod<TimeUnit.Second>
Link copied to clipboard
val <Unit : HourOrSmaller, TimeUnit> TimePeriod<Unit>.hour: Int
Link copied to clipboard
Link copied to clipboard
@get:JvmName(name = "dayHours")
val TimePeriod<TimeUnit.Day>.hours: Sequence<TimePeriod<TimeUnit.Hour>>
@get:JvmName(name = "monthHours")
val TimePeriod<TimeUnit.Month>.hours: Sequence<TimePeriod<TimeUnit.Hour>>
Link copied to clipboard
@get:JvmName(name = "yearLastDay")
val TimePeriod<TimeUnit.Year>.lastDay: TimePeriod<TimeUnit.Day>
@get:JvmName(name = "monthLastDay")
val TimePeriod<TimeUnit.Month>.lastDay: TimePeriod<TimeUnit.Day>
Link copied to clipboard
@get:JvmName(name = "monthLastHour")
val TimePeriod<TimeUnit.Month>.lastHour: TimePeriod<TimeUnit.Hour>
@get:JvmName(name = "dayLastHour")
val TimePeriod<TimeUnit.Day>.lastHour: TimePeriod<TimeUnit.Hour>
Link copied to clipboard
@get:JvmName(name = "dayLastMinute")
val TimePeriod<TimeUnit.Day>.lastMinute: TimePeriod<TimeUnit.Minute>
@get:JvmName(name = "hourLastMinute")
val TimePeriod<TimeUnit.Hour>.lastMinute: TimePeriod<TimeUnit.Minute>
Link copied to clipboard
val TimePeriod<TimeUnit.Year>.lastMonth: TimePeriod<TimeUnit.Month>
Link copied to clipboard
@get:JvmName(name = "dayLastSecond")
val TimePeriod<TimeUnit.Day>.lastSecond: TimePeriod<TimeUnit.Second>
@get:JvmName(name = "hourLastSecond")
val TimePeriod<TimeUnit.Hour>.lastSecond: TimePeriod<TimeUnit.Second>
@get:JvmName(name = "minuteLastSecond")
val TimePeriod<TimeUnit.Minute>.lastSecond: TimePeriod<TimeUnit.Second>
Link copied to clipboard
operator fun <Unit : TimeUnit> TimePeriod<Unit>.minus(difference: TimeDifference<Unit>): TimePeriod<Unit>

Subtracts a TimeDifference from this TimePeriod.

Link copied to clipboard
val <Unit : MinuteOrSmaller, TimeUnit> TimePeriod<Unit>.minute: Int
Link copied to clipboard
Link copied to clipboard
@get:JvmName(name = "hourMinutes")
val TimePeriod<TimeUnit.Hour>.minutes: Sequence<TimePeriod<TimeUnit.Minute>>
@get:JvmName(name = "dayMinutes")
val TimePeriod<TimeUnit.Day>.minutes: Sequence<TimePeriod<TimeUnit.Minute>>
Link copied to clipboard
val <Unit : MonthOrSmaller, TimeUnit> TimePeriod<Unit>.month: Month
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val <Unit : NanosecondOrSmaller, TimeUnit> TimePeriod<Unit>.nanosecond: Int
Link copied to clipboard
val <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.nextDay: TimePeriod<Unit>

Create a new TimePeriod by moving forward one day.

Link copied to clipboard
val <Unit : HourOrSmaller, TimeUnit> TimePeriod<Unit>.nextHour: TimePeriod<Unit>

Create a new TimePeriod by moving forward one hour.

Link copied to clipboard
val <Unit : MinuteOrSmaller, TimeUnit> TimePeriod<Unit>.nextMinute: TimePeriod<Unit>

Create a new TimePeriod by moving forward one minute.

Link copied to clipboard
val <Unit : MonthOrSmaller, TimeUnit> TimePeriod<Unit>.nextMonth: TimePeriod<Unit>

Create a new TimePeriod by moving forward one month.

Link copied to clipboard

Create a new TimePeriod by moving forward one nanosecond.

Link copied to clipboard
val <Unit : SecondOrSmaller, TimeUnit> TimePeriod<Unit>.nextSecond: TimePeriod<Unit>

Create a new TimePeriod by moving forward one second.

Link copied to clipboard
val <Unit : YearOrSmaller, TimeUnit> TimePeriod<Unit>.nextYear: TimePeriod<Unit>

Create a new TimePeriod by moving forward one year.

Link copied to clipboard
fun <Unit : TimeUnit> TimePeriod<Unit>.offset(count: Int): TimePeriod<Unit>
Link copied to clipboard
fun TimePeriod<*>.overlaps(other: TimePeriod<*>): Boolean
Link copied to clipboard
operator fun <Unit : TimeUnit> TimePeriod<Unit>.plus(difference: TimeDifference<Unit>): TimePeriod<Unit>

Adds a TimeDifference to this TimePeriod.

Link copied to clipboard
val <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.previousDay: TimePeriod<Unit>

Create a new TimePeriod by moving backward one day.

Link copied to clipboard
val <Unit : HourOrSmaller, TimeUnit> TimePeriod<Unit>.previousHour: TimePeriod<Unit>

Create a new TimePeriod by moving backward one hour.

Link copied to clipboard
val <Unit : MinuteOrSmaller, TimeUnit> TimePeriod<Unit>.previousMinute: TimePeriod<Unit>

Create a new TimePeriod by moving backward one minute.

Link copied to clipboard
val <Unit : MonthOrSmaller, TimeUnit> TimePeriod<Unit>.previousMonth: TimePeriod<Unit>

Create a new TimePeriod by moving backward one month.

Link copied to clipboard

Create a new TimePeriod by moving backward one nanosecond.

Link copied to clipboard
val <Unit : SecondOrSmaller, TimeUnit> TimePeriod<Unit>.previousSecond: TimePeriod<Unit>

Create a new TimePeriod by moving backward one second.

Link copied to clipboard
val <Unit : YearOrSmaller, TimeUnit> TimePeriod<Unit>.previousYear: TimePeriod<Unit>

Create a new TimePeriod by moving backward one year.

Link copied to clipboard
val <Unit : SecondOrSmaller, TimeUnit> TimePeriod<Unit>.second: Int
Link copied to clipboard
Link copied to clipboard
@get:JvmName(name = "minuteSeconds")
val TimePeriod<TimeUnit.Minute>.seconds: Sequence<TimePeriod<TimeUnit.Second>>
@get:JvmName(name = "hourSeconds")
val TimePeriod<TimeUnit.Hour>.seconds: Sequence<TimePeriod<TimeUnit.Second>>
Link copied to clipboard
fun <Unit : DayOrSmaller, TimeUnit> TimePeriod<Unit>.subtractingDays(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving backward some number of days.

Link copied to clipboard
fun <Unit : HourOrSmaller, TimeUnit> TimePeriod<Unit>.subtractingHours(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving backward some number of hours.

Link copied to clipboard
fun <Unit : MinuteOrSmaller, TimeUnit> TimePeriod<Unit>.subtractingMinutes(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving backward some number of minutes.

Link copied to clipboard
fun <Unit : MonthOrSmaller, TimeUnit> TimePeriod<Unit>.subtractingMonths(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving backward some number of months.

Link copied to clipboard

Create a new TimePeriod by moving backward some number of nanoseconds.

Link copied to clipboard
fun <Unit : SecondOrSmaller, TimeUnit> TimePeriod<Unit>.subtractingSeconds(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving backward some number of seconds.

Link copied to clipboard
fun <Unit : YearOrSmaller, TimeUnit> TimePeriod<Unit>.subtractingYears(count: Int): TimePeriod<Unit>

Create a new TimePeriod by moving backward some number of years.

Link copied to clipboard
fun <Unit : TimeUnit, DayOrSmaller> TimePeriod<Unit>.toLocalDate(): LocalDate

Constructs a kotlinx.datetime.LocalDate from a TimePeriod with Day or finer precision.

Link copied to clipboard
fun <Unit : TimeUnit, HourOrSmaller> TimePeriod<Unit>.toLocalDateTime(): LocalDateTime

Constructs a kotlinx.datetime.LocalDateTime from a TimePeriod with Hour or smaller precision.

Link copied to clipboard
val <Unit : YearOrSmaller, TimeUnit> TimePeriod<Unit>.year: Int
Link copied to clipboard